<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
      <script src="__PUBLIC__/plugins/kindeditor/kindeditor.js"></script>
      <script src="__PUBLIC__/plugins/kindeditor/lang/zh_CN.js"></script>
   </head>
   <style>
    .wst-tab-box{width:100%; height:auto; margin:0px auto;}
	.wst-tab-nav{margin:0; padding:0; height:25px; line-height:24px;position: relative;top:2px;left:3px;}
	.wst-tab-nav li{cursor:pointer;float:left; margin:0 0px; list-style:none; border:1px solid #ddd; border-bottom:none; height:24px; width:100px; text-align:center; background:#eeeeee;color:#000000;}
	.wst-tab-nav .on{background:#ffffff;color:#000000;border-bottom:0 none;}
	.wst-tab-content{padding:5px;width:99%; height:auto; border:1px solid #ddd;background:#FFF;}
    .wst-gallery-imgs{width:770px;height:auto;}
    .wst-gallery-img{width:140px;height:100px;float:left;overflow:hidden;margin:10px 5px 5px 5px;}
   </style>
   <script>
   $(function () {
	   $('#tab').TabPanel({tab:0});
	   KindEditor.ready(function(K) {
			editor1 = K.create('textarea[name="goodsDesc"]', {
				height:'250px',
				allowFileManager : false,
				allowImageUpload : true,
				items:[
				        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
				        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
				        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
				        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
				        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
				        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
				        'anchor', 'link', 'unlink', '|', 'about'
				],
				afterBlur: function(){ this.sync(); }
			});
		});
   });
   
   
   function changeStatus(id,v){
	   Plugins.waitTips({title:'信息提示',content:'正在操作，请稍后...'});
	   $.post("{:U('Admin/Auction/changeGoodsStatus')}",{id:id,status:v},function(data,textStatus){
				var json = WST.toJson(data);console.log(json);
				if(json.status=='1'){
					Plugins.setWaitTipsMsg({ content:'操作成功',timeout:1000,callback:function(){
						location.href="{:U('Admin/Group/index')}";
					}});
				}else{
					Plugins.closeWindow();
					Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
				
				}
	   });
   }
   </script>
   <body class="wst-page">
       <form name="myform" method="post" id="myform">
       <div id='tab' class="wst-tab-box">
		<ul class="wst-tab-nav">
	    	<li>商品信息</li>
	    	<li>商品属性</li>
	        <li>商品相册</li>
	    </ul>
    	<div class="wst-tab-content" style='width:98%;'>
    	<div class='wst-tab-item'>
	        <form name="myform" method="post" id="myform">
	        <input type='hidden' id='id' value='{$object.goodsId}'/>
	        <input type='hidden' id='shopId' value='{$object.shopId}'/>
                <table class="table table-hover table-striped table-bordered wst-form">
                    <tr>
                        <th width='120'>商品编号：</th>
                        <td width='300'>
                            {$object.goodsSn}
                        </td>
                        <td rowspan='11' style='padding:5px;'>
                            <img id='goodsImgPreview' src='<if condition="$object['goodsImg'] =='' ">__ROOT__/Apps/Home/View/default/img/store_default_sign.png<else/>__ROOT__/{$object['goodsImg']}</if>' width='440' height='440'/><br/>
                        </td>
                    </tr>
                    <tr>
                        <th width='120'>商品名称<font color='red'>*</font>：</th>
                        <td>{$object.goodsName}</td>
                    </tr>
                    <tr>
                        <th width='120'>店铺价格<font color='red'>*</font>：</th>
                        <td>{$object.shopPrice}</td>
                    </tr>
                    <tr>
                        <th width='120'>起拍价<font color='red'>*</font>：</th>
                        <td>{$object.auctionLowPrice}</td>
                    </tr>
                    <tr>
                        <th width='120'>递增价<font color='red'>*</font>：</th>
                        <td>{$object.auctionAddPrice}</td>
                    </tr>
                    <tr>
                        <th width='120'>一口价<font color='red'>*</font>：</th>
                        <td>{$object.auctionMinPrice}</td>
                    </tr>
                    <tr>
                        <th width='120'>保证金<font color='red'>*</font>：</th>
                        <td>{$object.auctionMarginMoney}</td>
                    </tr>
                    <tr>
                        <th width='120'>中标人数<font color='red'>*</font>：</th>
                        <td>{$object.auctionWinNum}</td>
                    </tr>
                    <tr>
                        <th width='120'>开始时间<font color='red'>*</font>：</th>
                        <td id="auctionStartTime">{$object.auctionStartTime}</td>
                    </tr>
                    <tr>
                        <th width='120'>结束时间<font color='red'>*</font>：</th>
                        <td id="auctionEndTime">{$object.auctionEndTime}</td>
                    </tr>
                    <tr>
                        <th width='120'>状态<font color='red'>*</font>：</th>
                        <td>
                            <if condition="$object.auctionStatus eq 0">未开始</if>
                            <if condition="$object.auctionStatus eq 1">进行中</if>
                            <if condition="$object.auctionStatus eq 2">已结束</if>
                        </td>
                    </tr>
                    <if condition="$object.auctionGoodStatus eq 2">
                        <tr>
                            <th width='120'>不通过理由<font color='red'>*</font>：</th>
                            <td colspan='3' >{$object.notPassReason}</td>
                        </tr>
                    </if>
                    <tr>
                        <th width='120'>副标题<font color='red'>*</font>：</th>
                        <td colspan='3' >{$object.auctionSecondTitle}</td>
                    </tr>
                    <tr>
                        <td colspan='3' style='padding-left:250px;'>
                            <button type="button" class="btn btn-danger" onclick='javascript:changeStatus({$object['id']},0)'>禁&nbsp;售</button>
                            <button type="button" class="btn btn-primary" onclick='javascript:location.href="{$referer}"'>返&nbsp;回</button>
                        </td>
                    </tr>
                </table>
	       </form>

	      </div>
	      <div class='wst-tab-item'>
	        <table class="table table-hover table-striped table-bordered wst-form">
	           <tr>
	             <th width='120'>商品分类：</th>
	             <td>{$object.attrCatName}&nbsp;</td>
	           </tr>
	           <tr>
	             <th width='120'>价格属性：</th>
	             <td style='margin:0px;'>
	             <if condition=" count($object.priceAttrs) gt 0">
					<table class="table wst-list" style='margin:0px;border-top:1px solid #ddd;'>
					<thead>
					<tr>
					  <th style='background:#f5f5f5'>属性</th>
					  <th style='background:#f5f5f5'>规格</th>
					  <th style='background:#f5f5f5'>价格</th>
					  <th style='background:#f5f5f5'>推荐</th>
					  <th style='background:#f5f5f5'>库存</th>
					</tr>
					</thead>
					<volist name="object.priceAttrs" id="vo">
					<tr style='margin:0px;'>
						<td nowrap width='100px'>{$vo.attrName}</td>
						<td>{$vo['attrVal']}</td>
						<td>{$vo['attrPrice']}</td>
						<td><if condition="$vo.isRecomm eq 1">是</if></td>
						<td>{$vo['attrStock']}</td>
					</tr>
					</volist>
					</table>
				 </if>
	             </td>
	           </tr>
	           <tr>
	             <th width='120' valign='top'>展示属性：</th>
	             <td style='margin:0px;'>
	             <if condition=" count($object.attrs) gt 0">
					<table class="table  wst-form" style='margin:0px;'>
					<volist name="object.attrs" id="vo">
					<if condition="$vo['attrContent'] !='' ">
					<tr style='margin:0px;border:0px;'>
						<th nowrap width='100px'>{$vo['attrName']}：</th>
						<td>{$vo['attrContent']}</td>
					</tr>
					</if>
					</volist>
					</table>
				 </if>
	             </td>
	           </tr>
	        </table>
	      </div>
	      <div class='wst-tab-item'>
	       <div id='galleryImgs' class='wst-gallery-imgs'>
	           <volist name="object['gallery']" id="vo" key='i'>
		       <div class="wst-gallery-img">
			       <img class="gallery-img" width='140' height='100' iv="{$vo.goodsThumbs}" v="{$vo.goodsImg}" src="__ROOT__/{$vo.goodsThumbs}"/>
		       </div>
		       </volist>
	       </div>
	       <div style='clear:both;'></div>
	      </div>
       </div>
       </div>
       </form>
   </body>
</html>